<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册界面-牛马新闻中心</title>
    <link rel="stylesheet" type="text/css" href="../CSS/Login.css">
    <script type="text/javascript" src="../JS/Login.js"></script>
    <script type="text/javascript" src="../JS/CheckLogin.js" defer="defer"></script>
    <!--检查登录态-->
</head>
<body>
<!--<%@ include file="Header.jsp" %>-->
<div class="mid_body">
    <div class="re">
        <ul>
            <li><img src="../IMGS/达达利亚.png" width="600px"  alt="图片"></li>
            <li><img src="../IMGS/迪奥娜.png" width="600px"  alt="图片"></li>
            <li><img src="../IMGS/钟离.png" width="600px"  alt="图片"></li>
            <li><img src="../IMGS/辛焱.png" width="600px"  alt="图片"></li>
        </ul>
    </div>
    <div class="mid_body_right" id="Login">
        <span>注册</span><br/>
        <input type="text" id="RUname" name="Uname" placeholder="请输入用户名(小于10位)"/><br/>
        <input type="password" id="RUpassword" name="password" placeholder="请输入密码（6-16位）"/><br/>
        <input type="password" id="QRUpassword" name="Upass2" placeholder="请输入密码"/><br/>
        <input type="text" id="RUmail" name="Umail" placeholder="请输入邮箱"/><br/>
        <input type="text" id="YZ" name="Umail" placeholder="请输入验证码" style="width: 40%"/>
        <input type="button" id="code" onclick="cc()" style="width: 34%;" title='点击更换验证码'/><br/>
        <input type="button" id="Registersub" value="注册"/>
    </div>
</div>
<script type="text/javascript">
    function cc() {
        code="";       /* 重置验证码*/
        var codel=4;
        var checkcode=document.getElementById("code");    /* 传值给验证码*/
        var random=new Array(0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
        for(var i=0; i<codel;i++) {
            var index = Math.floor(Math.random()*36);
            code += random[index];
        }
        checkcode.value=code;
    }
    cc();
</script>
<!--验证码-->
<!--<jsp:include page="Footer.jsp" flush="true" />-->
</body>
<script type="text/javascript">
    function CheckLogin() {
        var Uname = window.localStorage.getItem("Uname");
        var Uid = window.localStorage.getItem("Uid");
        if (Uname!=null&&Uid!=null){
            console.log("已登录");
            document.getElementsByClassName("unLogin")[0].style.display="none";
            document.getElementsByClassName("unLogin")[1].style.display="none";
            document.getElementsByClassName("Logining")[0].style.display="block";
            document.getElementsByClassName("Logining")[1].style.display="block";
        }else {
            console.log("未登录");
            document.getElementsByClassName("unLogin")[0].style.display="block";
            document.getElementsByClassName("unLogin")[1].style.display="block";
            document.getElementsByClassName("Logining")[0].style.display="none";
            document.getElementsByClassName("Logining")[1].style.display="none";
        }
    }
    CheckLogin();
</script>
<!--检查登录态-->
</html>